Conventionally, an optical sensor comprising a light-emitting device and light-receiving device which is arranged on a convey path detects positions of a paper sheet in a printer.
More specifically, in the case of a label paper sheet comprised of a layout sheet and labels, a transmission photointerrupter capable of measuring the amount of light passing through the label paper sheet is used as a sensor to detect label portions on which data are to be printed and gap portions between the label portions on which no data is to be printed. By comparing the output voltage from the sensor, which receives the transmitted light, with a reference voltage serving as a threshold value through a comparator, the label portions and gap portions can be determined.
On the other hand, in the case of a continuous tag paper sheet with marks at predetermined intervals, a reflection photointerrupter capable of measuring the amount of light reflected by the tag paper sheet is used as a sensor to detect inter-mark portions on which data are to be printed and mark portions on which no data is to be printed. By comparing the output voltage from the sensor, which receives the reflected light, with a reference voltage serving as a threshold value through the comparator, the inter-mark portions and mark portions can be determined.
However, in some cases, a conventional printer cannot accurately detect the position of the leading end of a paper sheet due to the characteristics of a sensor or the like. More specifically, when a printing medium such as a paper sheet used in the printer (e.g., a label paper sheet) is conveyed, and the leading end of a paper sheet portion (e.g., a label portion of the label paper sheet) starts crossing the sensor (e.g., a transmission photointerrupter), the sensor may not start detecting the position of the leading end of the paper sheet portion (e.g., the label portion) and may delay the detection. Alternatively, the sensor may start the detection when the leading end of the paper sheet portion has not started crossing the sensor.
In some cases, even when the leading end of a certain paper sheet such as a label paper sheet can accurately be detected, the leading end of another paper sheet cannot accurately be detected. Examples of the cases are one wherein a label paper sheet having a different label or layout sheet transmittance is used after the previous paper sheet, one wherein dust attracted to the paper sheet adversely affects the sensor, one wherein a change in light emission amount of the photointerrupter decreases the detection sensitivity of the sensor, and the like.
A printing start timing of a printhead is determined with respect to a detected paper sheet leading end. If the leading end of a paper sheet portion (e.g., a label portion of a label paper) cannot accurately be detected, as described above, the difference between a detected paper sheet leading end position obtained when the sensor detects the leading end of the paper sheet and an actual paper sheet leading end position appears as a shift in image print position. The shift in image print position prevents acquisition of a desired print result.